<!--
 * @Author: your name
 * @Date: 2021-05-26 19:44:54
 * @LastEditTime: 2021-06-05 16:06:28
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \tourismpc\src\views\tourism\components\culturalAttractions\CulturalAttractions.vue
-->
<template>
  <div class="Dining">
    <div class="culturalList">
      <div class="listItem" v-for="i in data" :key="i.cateringId" @click="goDetail(i.cateringId)">
        <div class="img">
          <img style="width:100%;height:100%" :src="i.titleImgUrl" alt />
        </div>
        <div class="text">
          <div class="hederText">
            <div class="title">{{ i.cateringName }}</div>
            <div class="price">
              <div>{{ i.cateringPrice }}RMB</div>
              <div>起</div>
            </div>
          </div>
          <div class="detailText">{{ i.cateringIntro }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Dining",
  props: {
    data: {
      type: Array,
      default: [],
    },
  },
  methods: {
    goDetail(cateringId) {
      this.$router.push({
        path: "/tourism/dining",
        query: {
          cateringId,
        },
      });
    },
  },
};
</script>
<style lang="less">
.Dining {
  .culturalList {
    overflow: hidden;
  }
  .listItem {
    width: 380px;
    height: 420px;
    float: left;
    border: 1px solid #dddddd;
    margin-bottom: 30px;
    cursor: pointer;
    margin-right: 37px;
    &:nth-child(3n) {
      margin-right: 0;
    }
    .img {
      height: 280px;
      border-bottom: 1px solid #dddddd;
    }
    .text {
      .hederText {
        padding: 22px 11px 14px 11px;
        overflow: hidden;
        .title {
          float: left;
          height: 28px;
          width: 240px;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
          line-height: 32px;
          color: #333333;
        }
        .price {
          float: right;
          display: flex;
          div {
            &:nth-child(1) {
              font-size: 24px;
              color: #f44a22;
              margin-bottom: -4px;
              margin-right: 2px;
            }
            &:nth-child(2) {
              display: flex;
              align-items: flex-end;
              color: #333333;
            }
          }
        }
      }
      .detailText {
        margin: 0 22px 14px 22px;
        font-size: 14px;
        color: #666666;
        display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
        word-break: break-all;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
        -webkit-line-clamp: 3; /** 显示的行数 **/
        overflow: hidden;
      }
    }
  }
}
</style>
